package service;

import java.util.List;

import bean.Address;
import bean.AddressRowMapper;
import bean.GoodsRowMapper;
import bean.OrderDetail;
import bean.OrderDetailRowMapper;
import common.BaseDAO;

public class OrderDetailDAO extends BaseDAO {
	//根据orderid和goodsid增加订单详情记录
	public void addOrderDetailRecord(int orderid,int goodsid,int num,double price,
			double cost,double subtotal,int status){
		String sql="insert into order_detail(orderid,goodsid,num,price,cost,subtotal,status"
				+ ") values(?,?,?,?,?,?,?)";
		this.update(sql, orderid,goodsid,num,price,cost,subtotal,status);
	}
	//根据orderid查找订单详情记录
	public List<OrderDetail> queryByOrderid(int orderid){
		String sql="select * from order_detail where orderid=?";
		return this.query(sql, new OrderDetailRowMapper(), orderid);
	}
}
